Skip to content

fix: improve IPv6 support in local Kind cluster setup#3693

Open
matejvasek wants to merge 3 commits intoknative:mainfrom
matejvasek:ipv6-improvements
Open

fix: improve IPv6 support in local Kind cluster setup#3693
matejvasek wants to merge 3 commits intoknative:mainfrom
matejvasek:ipv6-improvements

Conversation

@matejvasek
Copy link
Copy Markdown
Contributor

@matejvasek matejvasek commented May 10, 2026

Summary

Fixes two IPv6-related issues in hack/cluster.sh that break the local Kind development cluster on IPv6-only and dual-stack Docker networks:

  • Contour IPv6 bindings: Contour defaults its xDS server, Envoy listeners, and stats endpoint to 0.0.0.0 (IPv4-only). On IPv6-only clusters the control plane cannot reach Envoy and ingress traffic is blocked. The Contour deployment is now patched at install time to rebind --xds-address and --stats-address to :: alongside the existing HTTP/HTTPS address overrides.
    Note: :: listens on both IPv4 and IPv6 on Linux by default. However if machines completely disables IPv6 or deliberately sets net.ipv6.bindv6only = 1 the it might not listen on IPv4, but people doing that had it coming anyway.

  • CoreDNS DNS forwarding via socat: Docker's embedded DNS proxy only listens on IPv4 (moby/moby#41651), and Kind replaces the node's nameserver with the IPv4 bridge gateway (e.g. 172.18.0.1). On IPv6-only clusters CoreDNS pods cannot reach this address, breaking all DNS resolution. A socat UDP/TCP proxy is now installed on the Kind node when IPv4-only nameservers are detected, forwarding DNS from the node's IPv6 address to the IPv4 nameserver. The CoreDNS Corefile is patched to use this proxy instead of /etc/resolv.conf. See also DNS resolution broken on IPv6-only clusters with Docker: enable_network_magic() is IPv4-only kubernetes-sigs/kind#4152

Test plan

  • Run hack/cluster.sh on a Docker host with an IPv6-only Kind cluster and verify DNS resolution works inside pods
  • Run hack/cluster.sh on a dual-stack Kind cluster and verify both IPv4 and IPv6 DNS resolution work
  • Run hack/cluster.sh on a standard IPv4-only Kind cluster and verify no regressions (socat proxy should be skipped, Contour bindings are additive)
  • Verify Contour/Envoy ingress serves traffic on IPv6-only clusters

Contour defaults its xDS server, Envoy HTTP/HTTPS listeners, and stats
endpoint to 0.0.0.0 (IPv4-only). On IPv6-only clusters this prevents
the control plane from communicating with Envoy and blocks all ingress
traffic.

Patch the Contour deployment at install time to bind xds-address,
envoy-service-http-address, envoy-service-https-address, and
stats-address to :: so all components listen on IPv6.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Docker's embedded DNS proxy only listens on IPv4 (moby/moby#41651),
and Kind's entrypoint replaces the node's nameserver with the IPv4
bridge gateway (e.g. 172.18.0.1). On IPv6-only clusters CoreDNS pods
cannot reach this IPv4 address, breaking all DNS resolution.

Work around this by detecting IPv4-only nameservers on the Kind node
and installing a socat UDP/TCP proxy that forwards DNS from the node's
IPv6 address to the IPv4 nameserver. The CoreDNS Corefile is then
patched to forward to the node's IPv6 address instead of
/etc/resolv.conf. This preserves full container-runtime DNS resolution
including container names and search domains.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 10, 2026 13:46
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/S 🤖 PR changes 10-29 lines, ignoring generated files. labels May 10, 2026
@matejvasek matejvasek changed the title Ipv6 improvements Title: fix: improve IPv6 support in local Kind cluster setup May 10, 2026
@matejvasek matejvasek changed the title Title: fix: improve IPv6 support in local Kind cluster setup fix: improve IPv6 support in local Kind cluster setup May 10, 2026
@matejvasek matejvasek requested review from gauron99 and lkingland and removed request for dsimansk and jrangelramos May 10, 2026 13:47
@matejvasek
Copy link
Copy Markdown
Contributor Author

PTAL @gauron99 @lkingland

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.91%. Comparing base (9ba518e) to head (99dc6e1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3693   +/-   ##
=======================================
  Coverage   56.91%   56.91%           
=======================================
  Files         181      181           
  Lines       20933    20933           
=======================================
+ Hits        11913    11915    +2     
+ Misses       7811     7810    -1     
+ Partials     1209     1208    -1     
Flag Coverage Δ
e2e 36.13% <ø> (-0.02%) ⬇️
e2e go 32.75% <ø> (ø)
e2e node 28.48% <ø> (ø)
e2e python 33.11% <ø> (-0.01%) ⬇️
e2e quarkus 28.62% <ø> (+0.02%) ⬆️
e2e rust 28.03% <ø> (ø)
e2e springboot 26.52% <ø> (ø)
e2e typescript 28.59% <ø> (ø)
e2e-config-ci 17.88% <ø> (ø)
integration 17.43% <ø> (+0.01%) ⬆️
unit macos-14 45.00% <ø> (ø)
unit macos-latest 45.00% <ø> (ø)
unit ubuntu-24.04-arm 45.17% <ø> (ø)
unit ubuntu-latest 45.85% <ø> (ø)
unit windows-latest 44.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@knative-prow knative-prow Bot added size/M 🤖 PR changes 30-99 lines, ignoring generated files. and removed size/S 🤖 PR changes 10-29 lines, ignoring generated files. labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. size/M 🤖 PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant